﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;

namespace IdentityManager.Controllers
{
    [Authorize]
    public class AccessCheckerController : Controller
    {
        // Anyone can access this
        [AllowAnonymous]
        public IActionResult AllAccess()
        {
            return View();
        }

        // Anyone that has logged in can access        
        public IActionResult AuthorizedAccess()
        {
            return View();
        }

        // account with role of user or admin can access
        [Authorize(Roles = $"{SD.Admin},{SD.User}")]
        public IActionResult UserORAdminRoleAccess()
        {
            return View();
        }

        // account with role of user and admin can access
        [Authorize(Policy = "AdminAndUser")]
        public IActionResult UserANDAdminRoleAccess()
        {
            return View();
        }


        [Authorize(Policy = "Admin")]
        // account with role of admin can access
        public IActionResult AdminRoleAccess()
        {
            return View();
        }

        [Authorize(Policy = "AdminRole_CreateClaim")]
        // account with admin role and create Claim can access
        public IActionResult Admin_CreateAccess()
        {
            return View();
        }

        [Authorize(Policy = "AdminRole_CreateEditDeleteClaim")]
        // account with admin role and (create && Edit && Delete) Claims can access
        public IActionResult Admin_Create_Edit_DeleteAccess()
        {
            return View();
        }


        [Authorize(Policy = "AdminRole_CreateEditDeleteClaim_ORSuperAdminRole")]
        // account with admin role and (create && Edit && Delete) Claims can access
        public IActionResult AdminRole_CreateEditDeleteClaim_OR_SuperAdminRole()
        {
            return View();
        }

        [Authorize(Policy = "AdminWithMoreThan1000Days")]
        public IActionResult OnlyBhrugen()
        {

            return View();
        }


        [Authorize(Policy = "FirstNameAuth")]
        public IActionResult FirstNameAuth()
        {

            return View();
        }

    }
}
